﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    public class DictionaryDemo1
    {
        public static void Main()
        {
            Dictionary<string, string> dics = new Dictionary<string, string>();

            dics.Add("aa", "apple");
            dics.Add("bb", "Bat");
            dics.Add("cc", "Cat");

            foreach (var dic in dics)
            {
                Console.WriteLine("Key is " + dic.Key);
                Console.WriteLine("Value is " + dic.Value);
            }

            var dc = dics.Where(d => d.Key.Equals("bb")).FirstOrDefault();
            Console.WriteLine("Value is "+dc.Value);
            Console.Read();
        }
    }
}
